<?php

/**
 * Albireo Kernel
 *
 * @copyright  Copyright (c) 2010 Albireo Solutions
 * @package    Kernel
 */
namespace Celebrio\Util;

use \Nette\Object;
use \Nette\Environment;

/**
 * @author Pavel
 */

abstract class CacheName extends Object {

    /**
     * Getting the class name (with namespace) where all namespace dividers
     * (backslash signs) are replaced by dots (java ftw). It might be used
     * for example when creating Nette\Cache namespace.
     *
     * @return Nette\Caching\Cache cache identified by dot-separated class namespace + name
     */
    public static function generate(Object $clazz) {
        $className = $clazz::getReflection()->name;
        return Environment::getCache(\str_replace("\\", ".", $className));
    }
    
}